module.exports = class extends think.Logic {
  async postAction() {
    const data = this.post();
    this.allowMethods = 'post'; //  只允许 POST 请求类型
    this.rules = {
      username: {
        required: true
      },
      password: {
        required: true
      }
    };
    if (!this.validate(this.rules)) {
      return this.fail(400, '参数校验失败');
    }
  };
};
